import moment from "moment";
import config from '@/config'
/**
 * 控制台工具类
 * @author liu_jshan
 * @date 2024-10-13
 */

const appName = config.appName || 'APP'

function log(msg, ...otherArgs) {
   console.log(`${moment().format('YYYY-MM-DDTHH:mm:ss')} INFO [${appName}] ${msg}`, ...otherArgs)
}

function error(msg, ...otherArgs) {
    console.error(`${moment().format('YYYY-MM-DDTHH:mm:ss')} ERROR [${appName}] ${msg}`, ...otherArgs)
}

const consoleUtil = {
    log,
    error
}

export default consoleUtil